'gclass.bi

#ifndef _UI_GCLASS_BI__
#define _UI_GCLASS_BI__ -1

#macro DEF_PROPERTY(prp,type)
declare property prp () as type
declare property set##prp (byval as type)
m_##prp as type
#endmacro

#macro DEF_BYREF_PROPERTY(prp,type)
declare property prp () as type
declare property set##prp (byref as type)
m_##prp as type
#endmacro

#macro DEF_BPROPERTY(prp,type)
declare property prp () as type
declare property set##prp (byval as type)
#endmacro

#macro DEF_SBPROPERTY(prp,type)
declare property set##prp (byval as type)
#endmacro

#macro DEF_BYREF_BPROPERTY(prp,type)
declare property prp () as type
declare property set##prp (byref as type)
#endmacro

#macro DEF_INDEXED_PROPERTY(prp,typei,type)
declare property prp (byval as typei) as type
declare property set##prp (byval as typei, byval as type)
#endmacro

#macro IMP_PROPERTY(class,prp,type)
property class.prp () as type
	return m_##prp
end property
property class.set##prp ( byval _x_ as type )
	m_##prp = _x_
end property
#endmacro

#macro IMP_BYREF_PROPERTY(class,prp,type)
property class.prp () as type
	return m_##prp
end property
property class.set##prp ( byref _x_ as type )
	m_##prp = _x_
end property
#endmacro

#macro gclass(x)
#ifndef GUI_CLASS_##x
#define GUI_CLASS_##x -1

:
type x FIELD=1 :
	___base as BaseWidget
:

#else
#error ***********Class > ##x< already defined*********
#endif
#EndMacro

#define endgclass end type
#define BaseObject ___base

#define toBaseWidget(x) cast(BaseWidget ptr, (x))

#define connectSignal(wid,signal,proc) toBaseWidget(wid)->set##signal = @proc
#define disconnectSignal(wid,signal,proc) toBaseWidget(wid)->set##signal = @proc
#define emitSignal(wid,edata) toBaseWIdget(wid)->process_event(wid,edata)

#define SLOT(proc) function proc ( byval ref as BaseWidget ptr, byval e as _GUI_EVENT_ ptr ) as integer
#define STATIC_SLOT(proc) static function proc ( byval ref as BaseWidget ptr, byval e as _GUI_EVENT_ ptr ) as integer
#define ENDSLOT end function

#define SetParent(x) ___base.parent = (x) : ___base.parent->addChild(cast(ui.BaseWidget ptr,@this))
#define ParentObject ___base.parent

#endif
